
// 全局注册组件 指令 过滤器

import Vue from "vue"
import Menu from "@/components/Menu.vue"


Vue.component("Menu",Menu);


Vue.filter("scoreColor",value=>{
    if(!value) return value
    var n = parseInt(value/10);
    switch(n){
        case 9:
        return "success";
        break;
        case 8:
        return "primary";
        break;
        case 7:
        return "info";
        break;
        case 6:
        return "warning";
        break;
        default:
        return "danger";
        break;
    }
})

Vue.filter("scoreLevel",value=>{
    if(!value) return value
    var n = parseInt(value/10);
    switch(n){
        case 10:
        return "S+";
        break;
        case 9:
        return "A";
        break;
        case 8:
        return "B";
        break;
        case 7:
        return "C";
        break;
        case 6:
        return "D";
        break;
        default:
        return "E";
        break;
    }
})